Skip to main content

GetStyle

Returns the paragraph style method.

Syntax

expression.GetStyle();

expression - A variable that represents a ApiParaPr class.

Parameters

This method doesn't have any parameters.

Returns

ApiStyle

Example

This example shows how to get the paragraph style.

let doc = Api.GetDocument();
let heading6Style = doc.GetStyle("Heading 6");
let paragraph = doc.GetElement(0);
let paraPr = paragraph.GetParaPr();
paraPr.SetJc("center");
paraPr.SetStyle(heading6Style);
paragraph.AddText("This is a text in a paragraph styled with the 'Heading 6' style.");
let style = paraPr.GetStyle();
paragraph.AddLineBreak();
paragraph.AddText("Style: " + style.GetName());